package com.zlp.spring.init.strategy;

import com.zlp.spring.init.config.SpringConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Created by wangbin33 on 2020/2/17.
 *
 * 策略测试类.
 */
public class ReportStrategyTest {
	public static void main(String[] args) {

		ApplicationContext ac = new AnnotationConfigApplicationContext(SpringConfig.class);
		ReportStrategyFactory reportStrategyFactory = (ReportStrategyFactory)ac.getBean("reportStrategyFactory");
		ReportStrategy reportStrategy = reportStrategyFactory.getReportStrategy(ReportStrategyFactory.DrugCode.PD);
		Report report = reportStrategy.genericReport();
		System.out.println(report.toString());

	}
}
